#include <kernel.h>

void
LD_SYM(dde_kit_print)(const char *msg)
{
	 ekf_kprintf("%s", msg);
}

void
LD_SYM(dde_kit_printf)(const char *fmt, ...)
{
	 va_list ap;
	 va_start(ap, fmt);
	 ekf_vkprintf(fmt, ap);
	 va_end(ap);
}

void
LD_SYM(dde_kit_vprintf)(const char *fmt, va_list va)
{
	 ekf_vkprintf(fmt, va);
}

void
LD_SYM(dde_kit_print_cur_proc)(void)
{
	 ekf_kprintf("[proc %08x]\n", proc_self());
}

void
LD_SYM(dde_kit_print_backtrace)(void)
{
	 print_backtrace(0, 0);
}

#if DK_EXPORT_SYM

void
dde_kit_printf_symbol(void)
{
	 elf_mod_export_symbol("dde_kit_print", &dde_kit_print, 1);
	 elf_mod_export_symbol("dde_kit_printf", &dde_kit_printf, 1);
	 elf_mod_export_symbol("dde_kit_vprintf", &dde_kit_vprintf, 1);
	 elf_mod_export_symbol("dde_kit_print_cur_proc", &dde_kit_print_cur_proc, 1);
	 elf_mod_export_symbol("dde_kit_print_backtrace", &dde_kit_print_backtrace, 1);
}

#endif
